<script type="text/javascript" src="<?php bloginfo('template_url');?>/js/mybookinghotel.js"></script>	
	 		<style>
				 p label.contact_error
				{
					display:none;
				}
				 p label.contact_error_show
				{
					display:block;
					color:red;
					font-weight:bold;
					float:left;
					margin-left:5px;
					width:20px;
				}
			</style>
<div class="row-1">
                    	<h3><span>1</span>Hotel Information</h3>
                        <div class="box-bottom">
                        	<p>
                            	<label>Hotel :</label>
                                <span><?php echo get_the_title($hotel_ID);?></span>
                                <input type="hidden" name="hidden_hotel_ID" value="<?php echo $hotel_ID;?>">
                            </p>
                            <p>
                            	<label>Address :</label>
                                <span><?php echo get_post_meta($hotel_ID, $wpdb->prefix.'address',true);?></span>
                            </p>
                            <p>
                            	<label>Rating : 	 </label>
                            	<?php $rating = get_post_meta($hotel_ID, $wpdb->prefix.'rating',true);?>
                                <span class="star">
                                	<?php 
                                	for($i=1;$i<=$rating;$i++)
                                	{
                                		?>
                                		<img alt="" src="<?php bloginfo('template_url');?>/images/star.png" />
                                		<?php 
                                	}
                                	?>
                                </span>
                            </p>                            
                            <p>
                            	<label>Type Room : 		</label>
                            	<?php 
                            	//$hotel_price = db_select_all_data("hotel_price");                            	
                            	$hotel_price = db_select_all_data_by_hotelID("hotel_price",$hotel_ID);
                            	?>
                                <select name="type_room" id="type_room">
                                	<option value="">Type room</option>
                                	<?php
                                	if($hotel_price)
                                	{
										foreach ($hotel_price as $value) 
										{	
											$key = db_get_key_type_room($value->typeroom);	
											if(isset($_SESSION['booking_hote_data']) && $_SESSION['booking_hote_data']['type_room']==$key)
											{
												?>
												<option selected="selected" value="<?php echo $key;?>"><?php echo $value->typeroom;?></option>
												<?php 
											}	
											else 
											{							
												?>
												<option value="<?php echo $key;?>"><?php echo $value->typeroom;?></option>
												<?php 
											}
										}
                                	} 
									?>
                                </select>
                                <label id="contact_error_type_room" class="contact_error">*</label>
                            </p>
                            <p>
                            	<label>Max : </label>
                                <!-- <span>2 adults 1 child</span> -->
                                <input readonly="readonly" style="border: none; font-weight: bold; color: #666; width:150px;" class="price" name="hotel_max" id="hotel_max" value="">
                            </p>
                            <p>
                       	    <label>Number of rooms : <span class="request">*</span></label>
                       	    	<select name="number_of_room" id="number_of_room">
                       	    	<?php
                       	    	for($i=1;$i<=10;$i++)
                       	    	{
                       	    		if(isset($_SESSION['booking_hote_data']) && $_SESSION['booking_hote_data']['number_of_room']==$i)
                       	    		{
                       	    		?>
                       	    		<option selected="selected" value="<?php echo $i;?>"><?php echo $i;?></option>
                       	    		<?php 	
                       	    		}
                       	    		else 
                       	    		{
                       	    		?>
                       	    		<option value="<?php echo $i;?>"><?php echo $i;?></option>
                       	    		<?php	
                       	    		}
                       	    	} 
                       	    	?>                       	    		
                       	    	</select>
                                <!-- <input type="text" name="number_of_room" value="1"/> -->
                            </p>
                            <p>
                            	<label>Check in date :<span class="request">*</span></label>
                            	<?php
                            	if(isset($_SESSION['booking_hote_data']) && $_SESSION['booking_hote_data']['dy_check_in_date']!=null)
                            	{
                            		$newDate_ID 	= $_SESSION['booking_hote_data']['dy_check_in_date'];
                            		$newDate_IM 	= $_SESSION['booking_hote_data']['mo_check_in_date'];
                            		$newDate_IY 	= $_SESSION['booking_hote_data']['yr_check_in_date'];            		
                            		
                            	}
                            	else 
                            	{
                            		 $originalDate = date('Y-m-d h:i:s');                                                
                                                $newDate_IY = date("Y", strtotime($originalDate));
                                                $newDate_IM = date("m", strtotime($originalDate));
                                                $newDate_ID = date("d", strtotime($originalDate));
                            	}
                                                                                    
                                            ?>
                                            <?php
                                            $date = date('Y');
                                            ?>
                                <select name="dy_check_in_date" id="dy_check_in_date">
                                	<?php
                    							for($i = 1;$i<=30;$i++)
                    							{
                    								if($i == $newDate_ID)
                    								{
                    								?>
                    									<option selected="selected" value="<?php echo $i;?>"><?php echo $i;?></option>
                    								<?php	
                    								}
                    								else 
                    								{
                    							?>
                    								<option value="<?php echo $i;?>"><?php echo $i;?></option>
                    							<?php
                    								} 								
                    							}	 
                    							?>	
                                </select>
                                <select name="mo_check_in_date" id="mo_check_in_date">
                                	<option <?php if($newDate_IM == 1) echo 'selected="selected"';?> value="01">January </option>
                                                <option <?php if($newDate_IM == 2) echo 'selected="selected"';?> value="02">February </option>
                                                <option <?php if($newDate_IM == 3) echo 'selected="selected"';?> value="03">March </option>
                                                <option <?php if($newDate_IM == 4) echo 'selected="selected"';?> value="04">April </option>
                                                <option <?php if($newDate_IM == 5) echo 'selected="selected"';?> value="05">May </option>
                                                <option <?php if($newDate_IM == 6) echo 'selected="selected"';?> value="06">June </option>
                                                <option <?php if($newDate_IM == 7) echo 'selected="selected"';?> value="07">July </option>
                                                <option <?php if($newDate_IM == 8) echo 'selected="selected"';?> value="08">August </option>
                                                <option <?php if($newDate_IM == 9) echo 'selected="selected"';?> value="09">September </option>
                                                <option <?php if($newDate_IM == 10) echo 'selected="selected"';?> value="10">October </option>
                                                <option <?php if($newDate_IM == 11) echo 'selected="selected"';?> value="11">November </option>
                                                <option <?php if($newDate_IM == 12) echo 'selected="selected"';?> value="12">December </option>
                                </select>
                                <select name="yr_check_in_date" id="yr_check_in_date">
                                	<?php                    								
                    								for($y = $date; $y <= $date+5 ; $y++)
                    								{
                    									if($y == $newDate_IY)
                    									{
                    									?>
                    										<option selected="selected" value="<?php echo $y;?>"> <?php echo $y;?> </option>
                    									<?php 										
                    									}
                    									else 
                    									{
                    									?>
                    										<option value="<?php echo $y;?>"> <?php echo $y;?> </option>
                    									<?php 	
                    									}					
                    								}				
                    							?>
                                </select>
                                <label id="contact_error_check_in" class="contact_error">*</label>
                            </p>
                            <p>
                            	<label>Check out date :<span class="request">*</span></label>
                            	<?php
                            	
                            	if(isset($_SESSION['booking_hote_data']) && $_SESSION['booking_hote_data']['dy_check_in_date']!=null)
                            	{
                            		$newDate_ID 	= $_SESSION['booking_hote_data']['dy_check_out_date'];
                            		$newDate_IM 	= $_SESSION['booking_hote_data']['mo_check_out_date'];
                            		$newDate_IY 	= $_SESSION['booking_hote_data']['yr_check_out_date'];            		
                            		
                            	}
                            	else 
                            	{
                            		$originalDate = date('Y-m-d h:i:s');
                                                
                                                $newDate_IY = date("Y", strtotime($originalDate));
                                                $newDate_IM = date("m", strtotime($originalDate));
                                                $newDate_ID = date("d", strtotime($originalDate));  
                            	}
                            	
                                                                                   
                                            ?>
                                            <?php
                                            $date = date('Y');
                                            ?>
                                <select name="dy_check_out_date" id="dy_check_out_date">
                                	<?php
                    							for($i = 1;$i<=30;$i++)
                    							{
                    								if($i == $newDate_ID)
                    								{
                    								?>
                    									<option selected="selected" value="<?php echo $i;?>"><?php echo $i;?></option>
                    								<?php	
                    								}
                    								else 
                    								{
                    							?>
                    								<option value="<?php echo $i;?>"><?php echo $i;?></option>
                    							<?php
                    								} 								
                    							}	 
                    							?>	
                                </select>
                                <select name="mo_check_out_date" id="mo_check_out_date">
                                	<option <?php if($newDate_IM == 1) echo 'selected="selected"';?> value="01">January </option>
                                                <option <?php if($newDate_IM == 2) echo 'selected="selected"';?> value="02">February </option>
                                                <option <?php if($newDate_IM == 3) echo 'selected="selected"';?> value="03">March </option>
                                                <option <?php if($newDate_IM == 4) echo 'selected="selected"';?> value="04">April </option>
                                                <option <?php if($newDate_IM == 5) echo 'selected="selected"';?> value="05">May </option>
                                                <option <?php if($newDate_IM == 6) echo 'selected="selected"';?> value="06">June </option>
                                                <option <?php if($newDate_IM == 7) echo 'selected="selected"';?> value="07">July </option>
                                                <option <?php if($newDate_IM == 8) echo 'selected="selected"';?> value="08">August </option>
                                                <option <?php if($newDate_IM == 9) echo 'selected="selected"';?> value="09">September </option>
                                                <option <?php if($newDate_IM == 10) echo 'selected="selected"';?> value="10">October </option>
                                                <option <?php if($newDate_IM == 11) echo 'selected="selected"';?> value="11">November </option>
                                                <option <?php if($newDate_IM == 12) echo 'selected="selected"';?> value="12">December </option>
                                </select>
                                <select name="yr_check_out_date" id="yr_check_out_date">
                                	<?php                    								
                    								for($y = $date; $y <= $date+5 ; $y++)
                    								{
                    									if($y == $newDate_IY)
                    									{
                    									?>
                    										<option selected="selected" value="<?php echo $y;?>"> <?php echo $y;?> </option>
                    									<?php 										
                    									}
                    									else 
                    									{
                    									?>
                    										<option value="<?php echo $y;?>"> <?php echo $y;?> </option>
                    									<?php 	
                    									}					
                    								}				
                    							?>
                                </select>
                                <label id="contact_error_check_out" class="contact_error">*</label>
                            </p>
                            <p>
                            	<label>Price :</label>
                            	<?php
                            	//$hotel_price = get_post_meta($hotel_ID, $wpdb->prefix.'price',true);
                            	//print_r($hotel_price);
                            	 if($hotel_price)
                                	{
										foreach ($hotel_price as $value) 
										{	
											$price = $value->max.'*|*'.$value->totalofroom.'*|*'.$value->roomempty.'*|*'.$value->ratefornight;
											$mykey = intval(db_get_key_type_room($value->typeroom));
											$myname = "hotel_price_name_".$mykey;										
											?>
											<input type="hidden" name="<?php echo $myname;?>" id="<?php echo $myname;?>" value="<?php echo $price;?>">
											<?php 
											
										}
                                	} 
                            	?>
                                <!-- <span class="price"><?php //echo $hotel_price;?> USD</span> -->
                                <input readonly="readonly" style="border: none; font-weight: bold; color: #666; width: 45px;" class="price" name="hotel_price_show" id="hotel_price_show" value="">USD
                                <input type="hidden" name="hidden_hotel_price" id="hidden_hotel_price" value="">
                            </p>
                            <p>
                            	<label>Deposit :</label>
                            	<?php
                            	$deposit_hotel = db_type_room_list();
                            	foreach ($deposit_hotel as $key=>$value) 
                            	{
                            		$key+=1;
                            		//$key_depo = "hotel_deposit_name_".$key;
                            		$depost = get_option("hotel_deposit_name_".$key);
                            		?>
                            		<input type="hidden" name="hotel_deposit_name_<?php echo $key;?>" id="hotel_deposit_name_<?php echo $key;?>" value="<?php echo $depost;?>">
                            		<?php 
                            	}
                            	?>
                                <!-- <span class="price">1000 USD</span> -->
                                <input readonly="readonly" style="border: none; font-weight: bold; color: #666; width: 45px;" class="price" name="hotel_deposit_show" id="hotel_deposit_show" value="">USD
                                <input type="hidden" name="hidden_hotel_deposit" id="hidden_hotel_deposit" value="">
                            </p>
                            <?php 
                            $hotel_node = get_option("setting_hotel_node");
                            if($hotel_node)
                            {
                            ?>
                            <p style="line-height: 20px; color: #666666;">
                            	<span style="color: red; font-weight: bold;">Note :</span>                            	
                                <i>
                                <?php echo $hotel_node;?>
                                </i>                                
                            </p>
                            <?php 
                            }
                            ?>
                        </div>
                    </div>			
<?php include TEMPLATEPATH.'/views/book/view-customer-form.php';?>
